Now accepts an extra "clip" parameter, which is the clipping rectangle to
authorFederico Mena Quintero <federico@nuclecu.unam.mx>
Wed, 17 Jun 1998 03:34:22 +0000 (03:34 +0000)
committerArturo Espinosa <unammx@src.gnome.org>
Wed, 17 Jun 1998 03:34:22 +0000 (03:34 +0000)
1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>

* gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
"clip" parameter, which is the clipping rectangle to use.  This
eliminates the extremely annoying flicker when exposing parts of
the handlebox.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkhandlebox.c

index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index 6cff5b39d0a10e49c762e49cbe90b964d0400e69..79e28b1e87265f53a0b5517a844543bb6458a0a4 100644 (file)
@@ -1,3 +1,10 @@
+1998-06-16  Federico Mena Quintero  <federico@nuclecu.unam.mx>
+
+       * gtk/gtkhandlebox.c (draw_textured_frame): Now accepts an extra
+       "clip" parameter, which is the clipping rectangle to use.  This
+       eliminates the extremely annoying flicker when exposing parts of
+       the handlebox.
+
 Tue Jun 16 14:08:08 PDT 1998 Manish Singh <yosh@gimp.org>
 
        * gtk/gtktable.c: fix from TimJ for off-by-one error in table
index dc45477ce27f73a031eac88863d0438622695128..6a9e6ece85a7b602ffa6cccce001182a75a961c2 100644 (file)
@@ -611,44 +611,49 @@ gtk_handle_box_draw_ghost (GtkHandleBox *hb)
 }
 
 static void
-draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow)
+draw_textured_frame (GtkWidget *widget, GdkWindow *window, GdkRectangle *rect, GtkShadowType shadow,
+                    GdkRectangle *clip)
 {
   int x, y;
   int xthick, ythick;
   GdkGC *light_gc, *dark_gc;
+  GdkRectangle dest;
 
-  gdk_draw_rectangle (window,
-                     widget->style->bg_gc[GTK_STATE_NORMAL],
-                     TRUE,
-                     rect->x, rect->y,
-                     rect->width, rect->height);
-
-  light_gc = widget->style->light_gc[GTK_STATE_NORMAL];
-  dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL];
-
-  xthick = widget->style->klass->xthickness;
-  ythick = widget->style->klass->ythickness;
-
-  gdk_gc_set_clip_rectangle (light_gc, rect);
-  gdk_gc_set_clip_rectangle (dark_gc, rect);
-
-  for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3)
-    for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6)
-      {
-       gdk_draw_point (window, light_gc, x, y);
-       gdk_draw_point (window, dark_gc, x + 1, y + 1);
-
-       gdk_draw_point (window, light_gc, x + 3, y + 1);
-       gdk_draw_point (window, dark_gc, x + 4, y + 2);
-      }
+  if (gdk_rectangle_intersect (rect, clip, &dest))
+    {
+      gdk_draw_rectangle (window,
+                         widget->style->bg_gc[GTK_STATE_NORMAL],
+                         TRUE,
+                         dest.x, dest.y,
+                         dest.width, dest.height);
+
+      light_gc = widget->style->light_gc[GTK_STATE_NORMAL];
+      dark_gc = widget->style->dark_gc[GTK_STATE_NORMAL];
+
+      xthick = widget->style->klass->xthickness;
+      ythick = widget->style->klass->ythickness;
+
+      gdk_gc_set_clip_rectangle (light_gc, &dest);
+      gdk_gc_set_clip_rectangle (dark_gc, &dest);
+
+      for (y = rect->y + ythick; y < (rect->y + rect->height - ythick); y += 3)
+       for (x = rect->x + xthick; x < (rect->x + rect->width - xthick); x += 6)
+         {
+           gdk_draw_point (window, light_gc, x, y);
+           gdk_draw_point (window, dark_gc, x + 1, y + 1);
+
+           gdk_draw_point (window, light_gc, x + 3, y + 1);
+           gdk_draw_point (window, dark_gc, x + 4, y + 2);
+         }
        
-  gdk_gc_set_clip_rectangle (light_gc, NULL);
-  gdk_gc_set_clip_rectangle (dark_gc, NULL);
+      gdk_gc_set_clip_rectangle (light_gc, NULL);
+      gdk_gc_set_clip_rectangle (dark_gc, NULL);
 
-  gtk_draw_shadow (widget->style, window,
-                  GTK_STATE_NORMAL, shadow,
-                  rect->x, rect->y,
-                  rect->width, rect->height);
+      gtk_draw_shadow (widget->style, window,
+                      GTK_STATE_NORMAL, shadow,
+                      rect->x, rect->y,
+                      rect->width, rect->height);
+    }
 }
 
 static void
@@ -706,7 +711,7 @@ gtk_handle_box_paint (GtkWidget      *widget,
   rect.width = (hb->handle_position == GTK_POS_LEFT) ? DRAG_HANDLE_SIZE : width;
   rect.height = (hb->handle_position == GTK_POS_TOP) ? DRAG_HANDLE_SIZE : height;
 
-  draw_textured_frame (widget, hb->bin_window, &rect, GTK_SHADOW_OUT);
+  draw_textured_frame (widget, hb->bin_window, &rect, GTK_SHADOW_OUT, event ? &event->area : area);
 
   if (bin->child && GTK_WIDGET_VISIBLE (bin->child))
     {